<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">

	<title>ASButtonNode Class Reference</title>

	<link rel="stylesheet" href="../css/style.css">
	<meta name="viewport" content="initial-scale=1, maximum-scale=1.4">
	<meta name="generator" content="appledoc 2.2.1 (build 1334)">
</head>
<body class="appledoc">
	<header>
		<div class="container" class="hide-in-xcode">
			
			<h1 id="library-title">
				<a href="../index.html">  </a>
			</h1>

			<p id="developer-home">
				<a href="../index.html">AsyncDisplayKit</a>
			</p>
			
		</div>
	</header>

	<aside>
		<div class="container">
			<nav>
				<ul id="header-buttons" role="toolbar">
					<li><a href="../index.html">Index</a></li>
<li><a href="../hierarchy.html">Hierarchy</a></li>

					<li id="on-this-page" role="navigation">
						<label>
							On This Page

							<div class="chevron">
								<div class="chevy chevron-left"></div>
								<div class="chevy chevron-right"></div>
							</div>

							<select id="jump-to">
	<option value="top">Jump To&#133;</option>
	

	
	
	<option value="tasks">Tasks</option>
	
	

	
	
	<optgroup label="Properties">
		
		<option value="//api/name/contentEdgeInsets">contentEdgeInsets</option>
		
		<option value="//api/name/contentHorizontalAlignment">contentHorizontalAlignment</option>
		
		<option value="//api/name/contentSpacing">contentSpacing</option>
		
		<option value="//api/name/contentVerticalAlignment">contentVerticalAlignment</option>
		
		<option value="//api/name/imageAlignment">imageAlignment</option>
		
		<option value="//api/name/laysOutHorizontally">laysOutHorizontally</option>
		
	</optgroup>
	

	

	
	<optgroup label="Instance Methods">
		
		<option value="//api/name/attributedTitleForState:">- attributedTitleForState:</option>
		
		<option value="//api/name/backgroundImageForState:">- backgroundImageForState:</option>
		
		<option value="//api/name/imageForState:">- imageForState:</option>
		
		<option value="//api/name/setAttributedTitle:forState:">- setAttributedTitle:forState:</option>
		
		<option value="//api/name/setBackgroundImage:forState:">- setBackgroundImage:forState:</option>
		
		<option value="//api/name/setImage:forState:">- setImage:forState:</option>
		
		<option value="//api/name/setTitle:withFont:withColor:forState:">- setTitle:withFont:withColor:forState:</option>
		
	</optgroup>
	
	
</select>
						</label>
					</li>
				</ul>
			</nav>
		</div>
	</aside>

	<article>
		<div id="overview_contents" class="container">
			<div id="content">
				<main role="main">
					<h1 class="title">ASButtonNode Class Reference</h1>

					
					<div class="section section-specification"><table cellspacing="0"><tbody>
						<tr>
	<th>Inherits from</th>
	<td><a href="../Classes/ASControlNode.html">ASControlNode</a> : <a href="../Classes/ASDisplayNode.html">ASDisplayNode</a> : ASDealloc2MainObject</td>
</tr><tr>
	<th>Declared in</th>
	<td>ASButtonNode.h</td>
</tr>
						</tbody></table></div>
					

                    

					
					
					<div class="section section-tasks">
						<a title="Tasks" name="tasks"></a>
						

						
						

						<div class="task-list">
							<div class="section-method">
	<a name="//api/name/contentSpacing" title="contentSpacing"></a>
	<h3 class="method-title"><code><a href="#//api/name/contentSpacing">&nbsp;&nbsp;contentSpacing</a></code>
</h3>

	<div class="method-info">
		<div class="pointy-thing"></div>

		<div class="method-info-container">
			
			
			<div class="method-subsection brief-description">
				<p>Spacing between image and title. Defaults to 8.0.</p>
			</div>
			
		    

			<div class="method-subsection method-declaration"><code>@property (nonatomic, assign) CGFloat contentSpacing</code></div>

		    
			

			

			

			

			

			

			
			<div class="method-subsection declared-in-section">
				<h4 class="method-subtitle">Declared In</h4>
				<p><code class="declared-in-ref">ASButtonNode.h</code></p>
			</div>
			
			
		</div>
	</div>
</div><div class="section-method">
	<a name="//api/name/laysOutHorizontally" title="laysOutHorizontally"></a>
	<h3 class="method-title"><code><a href="#//api/name/laysOutHorizontally">&nbsp;&nbsp;laysOutHorizontally</a></code>
</h3>

	<div class="method-info">
		<div class="pointy-thing"></div>

		<div class="method-info-container">
			
			
			<div class="method-subsection brief-description">
				<p>Whether button should be laid out vertically (image on top of text) or horizontally (image to the left of text).
ASButton node does not yet support RTL but it should be fairly easy to implement.
Defaults to YES.</p>
			</div>
			
		    

			<div class="method-subsection method-declaration"><code>@property (nonatomic, assign) BOOL laysOutHorizontally</code></div>

		    
			

			

			

			

			

			

			
			<div class="method-subsection declared-in-section">
				<h4 class="method-subtitle">Declared In</h4>
				<p><code class="declared-in-ref">ASButtonNode.h</code></p>
			</div>
			
			
		</div>
	</div>
</div><div class="section-method">
	<a name="//api/name/contentHorizontalAlignment" title="contentHorizontalAlignment"></a>
	<h3 class="method-title"><code><a href="#//api/name/contentHorizontalAlignment">&nbsp;&nbsp;contentHorizontalAlignment</a></code>
</h3>

	<div class="method-info">
		<div class="pointy-thing"></div>

		<div class="method-info-container">
			
			
			<div class="method-subsection brief-description">
				<p>Horizontally align content (text or image).
Defaults to ASHorizontalAlignmentMiddle.</p>
			</div>
			
		    

			<div class="method-subsection method-declaration"><code>@property (nonatomic, assign) ASHorizontalAlignment contentHorizontalAlignment</code></div>

		    
			

			

			

			

			

			

			
			<div class="method-subsection declared-in-section">
				<h4 class="method-subtitle">Declared In</h4>
				<p><code class="declared-in-ref">ASButtonNode.h</code></p>
			</div>
			
			
		</div>
	</div>
</div><div class="section-method">
	<a name="//api/name/contentVerticalAlignment" title="contentVerticalAlignment"></a>
	<h3 class="method-title"><code><a href="#//api/name/contentVerticalAlignment">&nbsp;&nbsp;contentVerticalAlignment</a></code>
</h3>

	<div class="method-info">
		<div class="pointy-thing"></div>

		<div class="method-info-container">
			
			
			<div class="method-subsection brief-description">
				<p>Vertically align content (text or image).
Defaults to ASVerticalAlignmentCenter.</p>
			</div>
			
		    

			<div class="method-subsection method-declaration"><code>@property (nonatomic, assign) ASVerticalAlignment contentVerticalAlignment</code></div>

		    
			

			

			

			

			

			

			
			<div class="method-subsection declared-in-section">
				<h4 class="method-subtitle">Declared In</h4>
				<p><code class="declared-in-ref">ASButtonNode.h</code></p>
			</div>
			
			
		</div>
	</div>
</div><div class="section-method">
	<a name="//api/name/contentEdgeInsets" title="contentEdgeInsets"></a>
	<h3 class="method-title"><code><a href="#//api/name/contentEdgeInsets">&nbsp;&nbsp;contentEdgeInsets</a></code>
</h3>

	<div class="method-info">
		<div class="pointy-thing"></div>

		<div class="method-info-container">
			
			
			<div class="method-subsection brief-description">
				<p>The insets used around the title and image node</p>
			</div>
			
		    

			<div class="method-subsection method-declaration"><code>@property (nonatomic, assign) UIEdgeInsets contentEdgeInsets</code></div>

		    
			

			

			

			
			<div class="method-subsection discussion-section">
				<h4 class="method-subtitle">Discussion</h4>
				<p>The insets used around the title and image node</p>
			</div>
			

			

			

			
			<div class="method-subsection declared-in-section">
				<h4 class="method-subtitle">Declared In</h4>
				<p><code class="declared-in-ref">ASButtonNode.h</code></p>
			</div>
			
			
		</div>
	</div>
</div><div class="section-method">
	<a name="//api/name/imageAlignment" title="imageAlignment"></a>
	<h3 class="method-title"><code><a href="#//api/name/imageAlignment">&nbsp;&nbsp;imageAlignment</a></code>
</h3>

	<div class="method-info">
		<div class="pointy-thing"></div>

		<div class="method-info-container">
			
			
			<div class="method-subsection brief-description">
				<p>@discusstion Whether the image should be aligned at the beginning or at the end of node. Default is <code>ASButtonNodeImageAlignmentBeginning</code>.</p>
			</div>
			
		    

			<div class="method-subsection method-declaration"><code>@property (nonatomic, assign) ASButtonNodeImageAlignment imageAlignment</code></div>

		    
			

			

			

			

			

			

			
			<div class="method-subsection declared-in-section">
				<h4 class="method-subtitle">Declared In</h4>
				<p><code class="declared-in-ref">ASButtonNode.h</code></p>
			</div>
			
			
		</div>
	</div>
</div><div class="section-method">
	<a name="//api/name/attributedTitleForState:" title="attributedTitleForState:"></a>
	<h3 class="method-title"><code><a href="#//api/name/attributedTitleForState:">&ndash;&nbsp;attributedTitleForState:</a></code>
</h3>

	<div class="method-info">
		<div class="pointy-thing"></div>

		<div class="method-info-container">
			
			
			<div class="method-subsection brief-description">
				<p>Returns the styled title associated with the specified state.</p>
			</div>
			
		    

			<div class="method-subsection method-declaration"><code>- (NSAttributedString *_Nullable)attributedTitleForState:(ASControlState)<em>state</em></code></div>

		    
			
			<div class="method-subsection arguments-section parameters">
				<h4 class="method-subtitle parameter-title">Parameters</h4>
				<table class="argument-def parameter-def">
				
					<tr>
						<th scope="row" class="argument-name"><code>state</code></th>
						<td><p>The state that uses the styled title. The possible values are described in ASControlState.</p></td>
					</tr>
				
				</table>
			</div>
			

			
			<div class="method-subsection return">
				<h4 class="method-subtitle parameter-title">Return Value</h4>
				<p>The title for the specified state.</p>
			</div>
			

			

			

			

			

			
			<div class="method-subsection declared-in-section">
				<h4 class="method-subtitle">Declared In</h4>
				<p><code class="declared-in-ref">ASButtonNode.h</code></p>
			</div>
			
			
		</div>
	</div>
</div><div class="section-method">
	<a name="//api/name/setAttributedTitle:forState:" title="setAttributedTitle:forState:"></a>
	<h3 class="method-title"><code><a href="#//api/name/setAttributedTitle:forState:">&ndash;&nbsp;setAttributedTitle:forState:</a></code>
</h3>

	<div class="method-info">
		<div class="pointy-thing"></div>

		<div class="method-info-container">
			
			
			<div class="method-subsection brief-description">
				<p>Sets the styled title to use for the specified state. This will reset styled title previously set with -setTitle:withFont:withColor:forState.</p>
			</div>
			
		    

			<div class="method-subsection method-declaration"><code>- (void)setAttributedTitle:(nullable NSAttributedString *)<em>title</em> forState:(ASControlState)<em>state</em></code></div>

		    
			
			<div class="method-subsection arguments-section parameters">
				<h4 class="method-subtitle parameter-title">Parameters</h4>
				<table class="argument-def parameter-def">
				
					<tr>
						<th scope="row" class="argument-name"><code>title</code></th>
						<td><p>The styled text string to use for the title.</p></td>
					</tr>
				
					<tr>
						<th scope="row" class="argument-name"><code>state</code></th>
						<td><p>The state that uses the specified title. The possible values are described in ASControlState.</p></td>
					</tr>
				
				</table>
			</div>
			

			

			

			

			

			

			
			<div class="method-subsection declared-in-section">
				<h4 class="method-subtitle">Declared In</h4>
				<p><code class="declared-in-ref">ASButtonNode.h</code></p>
			</div>
			
			
		</div>
	</div>
</div><div class="section-method">
	<a name="//api/name/setTitle:withFont:withColor:forState:" title="setTitle:withFont:withColor:forState:"></a>
	<h3 class="method-title"><code><a href="#//api/name/setTitle:withFont:withColor:forState:">&ndash;&nbsp;setTitle:withFont:withColor:forState:</a></code>
</h3>

	<div class="method-info">
		<div class="pointy-thing"></div>

		<div class="method-info-container">
			
			
			<div class="method-subsection brief-description">
				<p>Sets the title to use for the specified state. This will reset styled title previously set with -setAttributedTitle:forState.</p>
			</div>
			
		    

			<div class="method-subsection method-declaration"><code>- (void)setTitle:(NSString *)<em>title</em> withFont:(nullable UIFont *)<em>font</em> withColor:(nullable UIColor *)<em>color</em> forState:(ASControlState)<em>state</em></code></div>

		    
			
			<div class="method-subsection arguments-section parameters">
				<h4 class="method-subtitle parameter-title">Parameters</h4>
				<table class="argument-def parameter-def">
				
					<tr>
						<th scope="row" class="argument-name"><code>title</code></th>
						<td><p>The styled text string to use for the title.</p></td>
					</tr>
				
					<tr>
						<th scope="row" class="argument-name"><code>font</code></th>
						<td><p>The font to use for the title.</p></td>
					</tr>
				
					<tr>
						<th scope="row" class="argument-name"><code>color</code></th>
						<td><p>The color to use for the title.</p></td>
					</tr>
				
					<tr>
						<th scope="row" class="argument-name"><code>state</code></th>
						<td><p>The state that uses the specified title. The possible values are described in ASControlState.</p></td>
					</tr>
				
				</table>
			</div>
			

			

			

			

			

			

			
			<div class="method-subsection declared-in-section">
				<h4 class="method-subtitle">Declared In</h4>
				<p><code class="declared-in-ref">ASButtonNode.h</code></p>
			</div>
			
			
		</div>
	</div>
</div><div class="section-method">
	<a name="//api/name/imageForState:" title="imageForState:"></a>
	<h3 class="method-title"><code><a href="#//api/name/imageForState:">&ndash;&nbsp;imageForState:</a></code>
</h3>

	<div class="method-info">
		<div class="pointy-thing"></div>

		<div class="method-info-container">
			
			
			<div class="method-subsection brief-description">
				<p>Returns the image used for a button state.</p>
			</div>
			
		    

			<div class="method-subsection method-declaration"><code>- (nullable UIImage *)imageForState:(ASControlState)<em>state</em></code></div>

		    
			
			<div class="method-subsection arguments-section parameters">
				<h4 class="method-subtitle parameter-title">Parameters</h4>
				<table class="argument-def parameter-def">
				
					<tr>
						<th scope="row" class="argument-name"><code>state</code></th>
						<td><p>The state that uses the image. Possible values are described in ASControlState.</p></td>
					</tr>
				
				</table>
			</div>
			

			
			<div class="method-subsection return">
				<h4 class="method-subtitle parameter-title">Return Value</h4>
				<p>The image used for the specified state.</p>
			</div>
			

			

			

			

			

			
			<div class="method-subsection declared-in-section">
				<h4 class="method-subtitle">Declared In</h4>
				<p><code class="declared-in-ref">ASButtonNode.h</code></p>
			</div>
			
			
		</div>
	</div>
</div><div class="section-method">
	<a name="//api/name/setImage:forState:" title="setImage:forState:"></a>
	<h3 class="method-title"><code><a href="#//api/name/setImage:forState:">&ndash;&nbsp;setImage:forState:</a></code>
</h3>

	<div class="method-info">
		<div class="pointy-thing"></div>

		<div class="method-info-container">
			
			
			<div class="method-subsection brief-description">
				<p>Sets the image to use for the specified state.</p>
			</div>
			
		    

			<div class="method-subsection method-declaration"><code>- (void)setImage:(nullable UIImage *)<em>image</em> forState:(ASControlState)<em>state</em></code></div>

		    
			
			<div class="method-subsection arguments-section parameters">
				<h4 class="method-subtitle parameter-title">Parameters</h4>
				<table class="argument-def parameter-def">
				
					<tr>
						<th scope="row" class="argument-name"><code>image</code></th>
						<td><p>The image to use for the specified state.</p></td>
					</tr>
				
					<tr>
						<th scope="row" class="argument-name"><code>state</code></th>
						<td><p>The state that uses the specified title. The values are described in ASControlState.</p></td>
					</tr>
				
				</table>
			</div>
			

			

			

			

			

			

			
			<div class="method-subsection declared-in-section">
				<h4 class="method-subtitle">Declared In</h4>
				<p><code class="declared-in-ref">ASButtonNode.h</code></p>
			</div>
			
			
		</div>
	</div>
</div><div class="section-method">
	<a name="//api/name/setBackgroundImage:forState:" title="setBackgroundImage:forState:"></a>
	<h3 class="method-title"><code><a href="#//api/name/setBackgroundImage:forState:">&ndash;&nbsp;setBackgroundImage:forState:</a></code>
</h3>

	<div class="method-info">
		<div class="pointy-thing"></div>

		<div class="method-info-container">
			
			
			<div class="method-subsection brief-description">
				<p>Sets the background image to use for the specified state.</p>
			</div>
			
		    

			<div class="method-subsection method-declaration"><code>- (void)setBackgroundImage:(nullable UIImage *)<em>image</em> forState:(ASControlState)<em>state</em></code></div>

		    
			
			<div class="method-subsection arguments-section parameters">
				<h4 class="method-subtitle parameter-title">Parameters</h4>
				<table class="argument-def parameter-def">
				
					<tr>
						<th scope="row" class="argument-name"><code>image</code></th>
						<td><p>The image to use for the specified state.</p></td>
					</tr>
				
					<tr>
						<th scope="row" class="argument-name"><code>state</code></th>
						<td><p>The state that uses the specified title. The values are described in ASControlState.</p></td>
					</tr>
				
				</table>
			</div>
			

			

			

			

			

			

			
			<div class="method-subsection declared-in-section">
				<h4 class="method-subtitle">Declared In</h4>
				<p><code class="declared-in-ref">ASButtonNode.h</code></p>
			</div>
			
			
		</div>
	</div>
</div><div class="section-method">
	<a name="//api/name/backgroundImageForState:" title="backgroundImageForState:"></a>
	<h3 class="method-title"><code><a href="#//api/name/backgroundImageForState:">&ndash;&nbsp;backgroundImageForState:</a></code>
</h3>

	<div class="method-info">
		<div class="pointy-thing"></div>

		<div class="method-info-container">
			
			
			<div class="method-subsection brief-description">
				<p>Returns the background image used for a button state.</p>
			</div>
			
		    

			<div class="method-subsection method-declaration"><code>- (nullable UIImage *)backgroundImageForState:(ASControlState)<em>state</em></code></div>

		    
			
			<div class="method-subsection arguments-section parameters">
				<h4 class="method-subtitle parameter-title">Parameters</h4>
				<table class="argument-def parameter-def">
				
					<tr>
						<th scope="row" class="argument-name"><code>state</code></th>
						<td><p>The state that uses the image. Possible values are described in ASControlState.</p></td>
					</tr>
				
				</table>
			</div>
			

			
			<div class="method-subsection return">
				<h4 class="method-subtitle parameter-title">Return Value</h4>
				<p>The background image used for the specified state.</p>
			</div>
			

			

			

			

			

			
			<div class="method-subsection declared-in-section">
				<h4 class="method-subtitle">Declared In</h4>
				<p><code class="declared-in-ref">ASButtonNode.h</code></p>
			</div>
			
			
		</div>
	</div>
</div>
						</div>
						
					</div>
					
					

                    
                    
          
				</main>

				<footer>
					<div class="footer-copyright">
						
						<p class="copyright">Copyright &copy; 2016 AsyncDisplayKit. All rights reserved. Updated: 2016-11-05</p>
						
						
						<p class="generator">Generated by <a href="http://appledoc.gentlebytes.com">appledoc 2.2.1 (build 1334)</a>.</p>
						
					</div>
				</footer>
			</div>
		</div>
	</article>

	<script src="../js/script.js"></script>
</body>
</html>